package com.tcxhb.job.core.schedule;

import com.tcxhb.job.core.entity.ServerNode;
import com.tcxhb.job.core.service.job.ServerMonitor;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description:
 * @Auther: tcxhb
 * @Date: 2023/11/21
 */
public abstract class BaseScheduler implements Scheduler {
    @Autowired
    private ServerMonitor serverMonitor;

    protected boolean isRunningServer() {
        // 获取主机;
        String value = serverMonitor.runningServer();
        ServerNode node = serverMonitor.currentNode();
        if (node.getAddress().equals(value)) {
            return true;
        }
        return false;
    }
}
